package com.chain.BrotherExchange.ui.listener;

import android.view.View;

import com.chain.BrotherExchange.ui.activity.SettingTransactionPasswordActivity;
import com.chain.BrotherExchange.utils.Androids;

/**
 * 交易密码拦截
 */
public class TransactionPasswordIntercept implements View.OnClickListener {

    private final View.OnClickListener mOnClickListener;

    public TransactionPasswordIntercept(View.OnClickListener onClickListener) {
        this.mOnClickListener = onClickListener;
    }

    @Override
    public void onClick(View v) {
        if (Androids.LocalConfig.isSetTransactionPassword()) {
            mOnClickListener.onClick(v);
        } else {
            SettingTransactionPasswordActivity.launch(v.getContext());
        }
    }
}
